package com.kloyf.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

@Component
@ConfigurationProperties(prefix = "ali")
public class AliOssProperties {

    public final static String downFileCache = "oss_file:down:cache";

    @Value("${ali.bucketName}")
    private String bucketName;
    @Value("${ali.endpoint}")
    private String endpoint;
    @Value("${ali.accessKeyId}")
    private String accessKeyId;
    @Value("${ali.accessKeySecret}")
    private String accessKeySecret;


    @Value("${ali.taskNum}")
    private Integer taskNum;
    @Value("${ali.partSize}")
    private Long partSize;
    @Value("${ali.isCheckPoint}")
    private Boolean isCheckPoint;
    @Value("${ali.maxKeys}")
    private Integer maxKeys;

    @Value("${ali.callback.switch}")
    private Boolean callBackSwitch;
    @Value("${ali.callback.callbackUrl}")
    private String callbackUrl;
    @Value("${ali.callback.callbackHost}")
    private String callbackHost;
    //@Value("${ali.callback.callbackBody}")
    private String callbackBody;
    @Value("${ali.callback.callbackBodyType}")
    private String callbackBodyType;



    @Override
    public String toString() {
        return "AliOssProperties{" +
                "bucketName='" + bucketName + '\'' +
                ", endpoint='" + endpoint + '\'' +
                ", accessKeyId='" + accessKeyId + '\'' +
                ", accessKeySecret='" + accessKeySecret + '\'' +
                ", taskNum=" + taskNum +
                ", partSize=" + partSize +
                ", isCheckPoint=" + isCheckPoint +
                ", maxKeys=" + maxKeys +
                ", callBackSwitch=" + callBackSwitch +
                ", callbackUrl='" + callbackUrl + '\'' +
                ", callbackHost='" + callbackHost + '\'' +
                ", callbackBody='" + callbackBody + '\'' +
                ", callbackBodyType='" + callbackBodyType + '\'' +
                '}';
    }

    public Boolean getCallBackSwitch() {
        return callBackSwitch;
    }

    public void setCallBackSwitch(Boolean callBackSwitch) {
        this.callBackSwitch = callBackSwitch;
    }

    public String getCallbackUrl() {
        return callbackUrl;
    }

    public void setCallbackUrl(String callbackUrl) {
        this.callbackUrl = callbackUrl;
    }

    public String getCallbackHost() {
        return callbackHost;
    }

    public void setCallbackHost(String callbackHost) {
        this.callbackHost = callbackHost;
    }

    public String getCallbackBody() {
        return callbackBody;
    }

    public void setCallbackBody(String callbackBody) {
        this.callbackBody = callbackBody;
    }

    public String getCallbackBodyType() {
        return callbackBodyType;
    }

    public void setCallbackBodyType(String callbackBodyType) {
        this.callbackBodyType = callbackBodyType;
    }

    public String getBucketName() {
        return bucketName;
    }

    public void setBucketName(String bucketName) {
        this.bucketName = bucketName;
    }

    public String getEndpoint() {
        return endpoint;
    }

    public void setEndpoint(String endpoint) {
        this.endpoint = endpoint;
    }

    public String getAccessKeyId() {
        return accessKeyId;
    }

    public void setAccessKeyId(String accessKeyId) {
        this.accessKeyId = accessKeyId;
    }

    public String getAccessKeySecret() {
        return accessKeySecret;
    }

    public void setAccessKeySecret(String accessKeySecret) {
        this.accessKeySecret = accessKeySecret;
    }

    public Integer getTaskNum() {
        return taskNum;
    }

    public void setTaskNum(Integer taskNum) {
        this.taskNum = taskNum;
    }

    public Long getPartSize() {
        return partSize;
    }

    public void setPartSize(Long partSize) {
        this.partSize = partSize;
    }

    public Boolean getCheckPoint() {
        return isCheckPoint;
    }

    public void setCheckPoint(Boolean checkPoint) {
        isCheckPoint = checkPoint;
    }

    public Integer getMaxKeys() {
        return maxKeys;
    }

    public void setMaxKeys(Integer maxKeys) {
        this.maxKeys = maxKeys;
    }

//    public String getLocalUrl() {
//        return localUrl;
//    }
//
//    public void setLocalUrl(String localUrl) {
//        this.localUrl = localUrl;
//    }
}
